﻿using System.Runtime.CompilerServices;

namespace _模板方法模式
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("学生A抄的试卷");
            TestPaperA testPaper = new TestPaperA();
            testPaper.TestQuestion1();
            testPaper.TestQuestion2();
            testPaper.TestQuestion3();

            Console.WriteLine("学生B抄的试卷");
            TestPaperB testPaper2 = new TestPaperB();
            testPaper2.TestQuestion1();
            testPaper2.TestQuestion2();
            testPaper2.TestQuestion3();
        }
    }

    class TestPaper
    {
        public void TestQuestion1()
        {
            Console.WriteLine("杨过得到，后来给了郭靖，炼成倚天剑、屠龙刀的玄铁可能是[ ] a.球磨铸铁b.马口铁c.高速合金钢d.碳素纤维");
            Console.WriteLine($"答案：{Answer1()}");
        }

        public void TestQuestion2()
        {
            Console.WriteLine("杨过、程英、陆无双铲除了情花，造成[ ] a.使这种植物不再害人 b.使一种珍稀物种灭绝c.破坏了那个生物圈的生态平衡d.造成该地区沙漠化");
            Console.WriteLine($"答案：{Answer2()}");
        }
        public void TestQuestion3()
        {
            Console.WriteLine("蓝凤凰致使华山师徒、桃谷六仙呕吐不止，如果你是大夫，会给他们开什么药[ a.阿司匹林b.牛黄解毒片c.氟哌酸d.让他们喝大量的生牛奶e.以上全不对");
            Console.WriteLine($"答案：{Answer3()}");
        }

        protected virtual string Answer1()
        {
            return "";
        }
        protected virtual string Answer2()
        {
            return "";
        }
        protected virtual string Answer3()
        {
            return "";
        }
       
    }
    class TestPaperA : TestPaper
    {
        protected override string Answer1()
        {
            return "b";
        }
        protected override string Answer2()
        {
            return "c";
        }
        protected override string Answer3()
        {
            return "a";
        }
    }

    class TestPaperB : TestPaper
    {
        protected override string Answer1()
        {
            return "b";
        }
        protected override string Answer2()
        {
            return "c";
        }
        protected override string Answer3()
        {
            return "a";
        }
    }
}
